var form = $("#allotRes");
$(document).ready(function () {
    $("#addRoleSubmit").click(function () {
        $.ajax({
            type: "POST",
            url: "/sso/admin/role/allotRes",
            data: form.serialize(),
            async:false,
            success: function(data){
                if (data.status === 200) {
                    parent.layer.msg("权限分配成功");
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                } else {
                    parent.layer.msg("分配失败请重试");
                }
            }
        });
    });
    $("#roleForm").validate({
        errorPlacement: function (error, element) {
            element.before(error);
        },
        rules: {
        }
    });

});
